package com.apes.scm.masterdata.product.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 功能：品牌分类
 *
 * @author HuJianlin
 * @create 2018-03-15 16:00
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = "mas_brand_type")
public class BrandType extends Model {

    @Id
    @Column(name = "id", length = 16)
    @Comment("品牌分类编码")
    private String id;  //品牌分类编码

    @Column(name = "name", nullable = false, length = 120)
    @Comment("品牌分类名称")
    private String name; //品牌分类名称

    @Column(name = "valid", nullable = false, columnDefinition = "number(1,0) default 1")
    @Comment("有效标记")
    private boolean valid = true; //有效

}
